package c.e.a.b.f.b;

import android.os.Bundle;
import java.util.Map;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class a extends z1 {
    public final Map<String, Long> b = new b.f.a();
    public final Map<String, Integer> c = new b.f.a();
    public long d;

    public a(u4 u4Var) {
        super(u4Var);
    }

    public final void t(long j) {
        i7 w = q().w(false);
        for (String str : this.b.keySet()) {
            w(str, j - ((Long) this.b.get(str)).longValue(), w);
        }
        if (!this.b.isEmpty()) {
            u(j - this.d, w);
        }
        x(j);
    }

    public final void u(long j, i7 i7Var) {
        if (i7Var == null) {
            d().n.a("Not logging ad exposure. No active activity");
        } else if (j < 1000) {
            d().n.b("Not logging ad exposure. Less than 1000 ms. exposure", Long.valueOf(j));
        } else {
            Bundle bundle = new Bundle();
            bundle.putLong("_xt", j);
            h7.A(i7Var, bundle, true);
            n().H("am", "_xa", bundle);
        }
    }

    public final void v(String str, long j) {
        if (str == null || str.length() == 0) {
            d().f.a("Ad unit id must be a non-empty string");
        } else {
            a().v(new y0(this, str, j));
        }
    }

    public final void w(String str, long j, i7 i7Var) {
        if (i7Var == null) {
            d().n.a("Not logging ad unit exposure. No active activity");
        } else if (j < 1000) {
            d().n.b("Not logging ad unit exposure. Less than 1000 ms. exposure", Long.valueOf(j));
        } else {
            Bundle bundle = new Bundle();
            bundle.putString("_ai", str);
            bundle.putLong("_xt", j);
            h7.A(i7Var, bundle, true);
            n().H("am", "_xu", bundle);
        }
    }

    public final void x(long j) {
        for (String put : this.b.keySet()) {
            this.b.put(put, Long.valueOf(j));
        }
        if (!this.b.isEmpty()) {
            this.d = j;
        }
    }

    public final void y(String str, long j) {
        if (str == null || str.length() == 0) {
            d().f.a("Ad unit id must be a non-empty string");
        } else {
            a().v(new x(this, str, j));
        }
    }
}
